//
//  File.swift
//  
//
//  Created by S JZ on 2024/1/31.
//

import Foundation

public extension NSString {
    public var string: String { return self as String }
    
    @objc public func getWidth(font: JZFont, size boundingRectWithSize: CGSize) -> CGFloat {
        return string.getSize(font: font, size: boundingRectWithSize).width
    }
    
    @objc public func getWidth(font: JZFont, size boundingRectWithSize: CGSize, lineSpacing: CGFloat = 0.0) -> CGFloat {
        return string.getSize(font: font, size: boundingRectWithSize, lineSpacing: lineSpacing).width
    }
    
    @objc public func getHeight(font: JZFont, size boundingRectWithSize: CGSize) -> CGFloat {
        return string.getSize(font: font, size: boundingRectWithSize).height
    }
    
    @objc public func getHeight(font: JZFont, size boundingRectWithSize: CGSize, lineSpacing: CGFloat = 0.0) -> CGFloat {
        return string.getSize(font: font, size: boundingRectWithSize, lineSpacing: lineSpacing).height
    }
}
